package com.second.oa.domain;
// default package

import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;



public class Power  implements java.io.Serializable,Comparable<Power> {


    // Fields    

	 private String id;
	 private Power parent;
	 private String name;
	 private String powerValue;
	 private int powerLevel;
	 private Integer orderValue;
	 private int isMenu;
	 private Set powers = new TreeSet();
	 private Set roles = new HashSet(0);
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Power getParent() {
		return parent;
	}
	public void setParent(Power parent) {
		this.parent = parent;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPowerValue() {
		return powerValue;
	}
	public void setPowerValue(String powerValue) {
		this.powerValue = powerValue;
	}
	public int getPowerLevel() {
		return powerLevel;
	}
	public void setPowerLevel(int powerLevel) {
		this.powerLevel = powerLevel;
	}
	public Integer getOrderValue() {
		return orderValue;
	}
	public void setOrderValue(Integer orderValue) {
		this.orderValue = orderValue;
	}
	public int getIsMenu() {
		return isMenu;
	}
	public void setIsMenu(int isMenu) {
		this.isMenu = isMenu;
	}
	public Set getPowers() {
		return powers;
	}
	public void setPowers(Set powers) {
		this.powers = powers;
	}
	public Set getRoles() {
		return roles;
	}
	public void setRoles(Set roles) {
		this.roles = roles;
	}
	public Power() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Power(String id, Power parent, String name, String powerValue,
			int powerLevel, Integer orderValue, int isMenu, Set powers,
			Set roles) {
		super();
		this.id = id;
		this.parent = parent;
		this.name = name;
		this.powerValue = powerValue;
		this.powerLevel = powerLevel;
		this.orderValue = orderValue;
		this.isMenu = isMenu;
		this.powers = powers;
		this.roles = roles;
	}
	
	public int compareTo(Power o) {
		return orderValue - o.orderValue;
	}
}